<template>
	<uv-popup ref="popup" type="center" bg-color="#000" closeable overlayStyle="background: #000;" :closeOnClickOverlay="false">
		<uv-text text="完成" color="#fff" size="30px"></uv-text>
		<uv-text text="很棒，你已经知道了标准的指法让我们开始巩固练习吧～" color="#fff" size="26px"></uv-text>
		<uv-text :text="`Tips${content.tips}`" color="#ff0000" size="24px"></uv-text>
		<uv-button text="再来一次(R)" @click="again"></uv-button>
		<uv-button text="继续(Enter)" @click="next"></uv-button>
	</uv-popup>
</template>
<script setup>
	import { ref } from 'vue';
	const popup = ref(null);
	const content = ref({});
	// 打开
	function open(data) {
		content.value = data;
		popup.value && popup.value.open();
	}
	// 关闭
	function close() {
		popup.value && popup.value.close();
	}
	defineProps({
		tips: {
			type: String,
			default: ''
		}
	})
	// 再来一次
	function again() {
		uni.$emit('reloadCourse');
		close();
	}
	// 继续
	function next() {
		uni.$emit('nextCourse');
		close();
	}
	defineExpose({
		open
	})
</script>